/**
 * @ProjectName:exam
 * @FileName: SeatReservateRecord.java
 * @PackageName: edu.xpu.project.record.entity
 * @Company:北京有生博大软件有限公司（西安分公司）
 * @Copyright (c) 2017,RiseSoft  All Rights Reserved.
 * @date 2017年4月29日 下午5:15:40
 */
package edu.xpu.project.record.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import edu.xpu.project.user.entity.ProjectUser;
import edu.xpu.project.vehicle.entity.BusSchedule;

/**
 * @ClassName: SeatReservateRecord.java
 * @Description: 车次预定记录实体
 * 				记录 学生/老师在什么时间申请了哪个车次
 * 		老师--车次关系 记录
 *
 * @author liukang
 * @date 2017年4月29日 下午5:15:40
 * @version 
 * @since JDK 1.6
 */
@Entity(name="BusBespeakRecord")
@Table(name="BUS_BESPEAK_RECORD")
public class BusBespeakRecord implements Serializable {

	private static final long serialVersionUID = 1482510413504644002L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	
	@OneToOne(optional=true)
	@JoinColumn(name="user_id")
	private ProjectUser projectUser;
	
	
	private Date applyTime;		//申请时间(即该人员申请哪一天的车次)
	//private Long busScheduleId;	//车次id
	
	/*
	 * 状态
	 * 1: 已预订， 未交钱
	 * 2: 预定成功, 未交钱
	 * 3: 已坐车, 未交钱
	 * 
	 * 可以继续添加其他状态. 比如: 是否已经过期等等
	 */
	private Integer status = 1;
	
	
	/*
	 * 车次预定记录属于某一个车次
	 */
	@ManyToOne(optional=true, fetch=FetchType.EAGER)
	@JoinColumn(name="bus_schedule_id")
	private BusSchedule busSchedule;
	
	private Date createDate;		//系统录入时间

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public ProjectUser getProjectUser() {
		return projectUser;
	}

	public void setProjectUser(ProjectUser projectUser) {
		this.projectUser = projectUser;
	}

	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public BusSchedule getBusSchedule() {
		return busSchedule;
	}

	public void setBusSchedule(BusSchedule busSchedule) {
		this.busSchedule = busSchedule;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
}

